﻿using System;
using System.Collections.Generic;

namespace Gloo.Management {
    /// <summary>
    /// Represents a file for Gloo.
    /// </summary>
    public sealed class File {

        #region Fields

        private string path;
        private BuildAction buildAction;

        #endregion Fields

        #region Properties

        /// <summary>
        /// Gets the string used to separate paths in the current environment.
        /// </summary>
        public static string PathSeparator {
            get { return Environment.CurrentDirectory.Contains("/") ? "/" : "\\"; }
        }

        /// <summary>
        /// Gets or sets the path of the file.
        /// </summary>
        public string Path {
            get { return path; }
            set { path = value; }
        }

        /// <summary>
        /// Gets or sets the build action of this file.
        /// </summary>
        public BuildAction Action {
            get { return buildAction; }
            set { buildAction = value; }
        }

        #endregion Properties

        #region ctor()

        /// <summary>
        /// Creates a new file.
        /// </summary>
        /// <param name="path">The path of the file.</param>
        public File(string path) {
            if (!System.IO.File.Exists(path))
                System.IO.File.Create(path);
            this.path = path;
            buildAction = BuildAction.Compile;
        }

        #endregion ctor()

    }

    /// <summary>
    /// Contains an enumeration of build actions for files.
    /// </summary>
    public enum BuildAction {
        /// <summary>
        /// Describes the build action to simply compile the file.
        /// </summary>
        Compile = 0,
        /// <summary>
        /// Describes the build action to copy the file.
        /// </summary>
        Copy,
        /// <summary>
        /// Describes the build action to compile and copy the file.
        /// </summary>
        CompileAndCopy,
        /// <summary>
        /// Describes the build action to do nothing with the file.
        /// </summary>
        None
    }
}